home *** CD-ROM | disk | FTP | other *** search
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- #include "shared.fx"
- #include "lighting.fx"
- #define FOG_DISABLE // c'est mieux parce que sinon le gui il est fogguΘ et c'est pas terrible...
- #include "fog.fx"
-
-
- //------------------------------------------------------------------------------------------------------
- //- Static parameters
- //------------------------------------------------------------------------------------------------------
-
- float dummyParam;
-
- float3 light = {0, 10, 10};
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- struct CVertexShaderInput
- {
- float4 Position : POSITION;
- float3 Normal : NORMAL;
- };
-
- //------------------------------------------------------------------------------------------------------
-
- struct CVertexShaderOutput
- {
- float4 Position : POSITION;
- float3 Normal : TEXCOORD0;
- float3 Light : TEXCOORD1;
- };
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- CVertexShaderOutput OpaSelfIllumGeomTech1Pass1 (const CVertexShaderInput input)
- {
- CVertexShaderOutput output;
-
- // output position into world+view+projection space
- output.Position = mul(input.Position, WorldCameraProjection);
- output.Light = normalize(light);
- output.Normal = normalize(mul(input.Normal, World)); // transform Normal and normalize it
- //output.Normal = input.Normal; // transform Normal and normalize it
-
- return output;
- }
-
- float4 OpaSelfIllumGeomTech1Pass1PS(const CVertexShaderOutput output) : COLOR
- {
- float4 diffuse = { 1.0f, 0.0f, 0.0f, 1.0f};
- float4 ambient = {0.1, 0.0, 0.0, 1.0};
- float4 color = max(0, (dot(output.Light, output.Normal)));
- color.a = 1.0f;
- return color;
- }
-
-
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- #define RenderStates \
- CullMode = CCW; \
- ZEnable = true; \
- ZFunc = LESSEQUAL; \
- ZWriteEnable = true; \
- AlphaBlendEnable = false; \
- AlphaTestEnable = true; \
- AlphaRef = 192; \
- AlphaFunc = GREATEREQUAL ; \
- FogEnable = false
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- technique tech1
- <
- int Priority = 1;
- int TechniqueIndex = 0;
- int DeviceType = HWSHADER_ONLY;
- int LightingType = INTEGRATED_LIGHTING;
- string RenderingType = "Standard";
- >
- {
- pass pass1
- {
- RenderStates;
-
- VertexShader = compile vs_1_1 OpaSelfIllumGeomTech1Pass1();
-
- PixelShader = compile ps_2_0 OpaSelfIllumGeomTech1Pass1PS();
- //asm
- //{
- // ps_1_1
-
- // def c0, 1.0, 0.0, 0.0, 1.0
-
- // mov r0, c0
- //};
- }
- }
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- #include "mesh_shadow.fx"
- #include "mesh_shadow_projector.fx"
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------